<template>
  <div v-if="article" class="article">
    <div class="content" v-html="article.content"></div>
    <div class="auth">
      作者:
      {{ article.authName }}
    </div>
    <div class="date">
      发表日期:
      {{ article.date }}
    </div>
    <div class="type">
      文章分类:
      {{ article.typeName }}
    </div>
  </div>
</template>

<script>
import { mapGetters, mapActions } from "vuex";
export default {
  methods: {
    ...mapActions(["getArticle"])
  },
  computed: {
    ...mapGetters(["article"])
  },
  created() {
    this.getArticle(this.$route.params.id);
  }
};
</script>

<style scoped>
.article {
  padding: 20px;
  background-color: #ffffff80;
}
.content {
  margin: 20px;
}
</style>
